package com.microservice.salmon.db.entities;

import com.salmon.common.tree.ITree;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;

@Table(name = "t_shop_menu")
@Data
@EqualsAndHashCode(of = "id")
public class ShopMenu implements ITree {

    private static final long serialVersionUID = -1229167580962358753L;
    /**
     * 编号
     */
    @Id
    private Integer id;

    /**
     * 父级编号
     */
    @Column(name = "parent_id")
    private Integer parentId;

    /**
     * 所有父级编号
     */
    @Column(name = "parent_ids")
    private String parentIds;

    /**
     * 名称
     */
    private String name;

    /**
     * 排序
     */
    @Column(name = "menu_sort")
    private Long menuSort;

    /**
     * 链接
     */
    private String href;

    /**
     * 目标
     */
    private String target;

    /**
     * 图标
     */
    private String icon;

    /**
     * 是否在菜单中显示
     */
    @Column(name = "is_show")
    private String isShow;

    /**
     * 权限值
     */
    private String permission;

    /**
     * 创建者
     */
    @Column(name = "create_by")
    private String createBy;

    /**
     * 更新者
     */
    @Column(name = "update_by")
    private String updateBy;

    /**
     * 备注信息
     */
    private String remarks;

    /**
     * 有效状态 1:有效 -1:无效
     */
    @Column(name = "data_flag")
    private Byte dataFlag;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    private List<ITree> children;
}